import clr
clr.AddReference("Tao.FreeGlut")
clr.AddReference("Tao.OpenGl")
import System
from Tao.OpenGl import Gl
from Tao.FreeGlut import Glut


def Display():
    Gl.glClear(Gl.GL_COLOR_BUFFER_BIT)
    Gl.glColor3f(1.0, 1.0, 1.0)
    Gl.glBegin(Gl.GL_POLYGON)
    Gl.glVertex3f(0.25, 0.25, 0.0)
    Gl.glVertex3f(0.75, 0.25, 0.0)
    Gl.glVertex3f(0.75, 0.75, 0.0)
    Gl.glVertex3f(0.25, 0.75, 0.0)
    Gl.glEnd()
    Gl.glFlush()


def Init():
    Gl.glClearColor(0.0, 0.0, 0.0, 0.0)
    # Initialize viewing values
    Gl.glMatrixMode(Gl.GL_PROJECTION)
    Gl.glLoadIdentity()
    Gl.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0)

def main():
    Glut.glutInit()
    Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB)
    Glut.glutInitWindowSize(250, 250)
    Glut.glutInitWindowPosition(100, 100)
    Glut.glutCreateWindow("Hello")
    Init()
    Glut.glutDisplayFunc(Glut.DisplayCallback(Display))
    Glut.glutMainLoop()

if __name__ == "__main__":
    main()
